#pragma once
#include "global.h"
#include <string>
#include <boost/date_time.hpp>
#include "xpt/xptClient.h"

class LMContext
{
public:
	LMContext(void);
	virtual ~LMContext(void);

	std::string User() const { return _user; }
	void User(std::string val) { _user = val; }
	std::string Password() const { return _password; }
	void Password(std::string val) { _password = val; }
	std::string PoolIp() const { return _poolIp; }
	void PoolIp(std::string val) { _poolIp = val; }
	int PoolPort() const { return _poolPort; }
	void PoolPort(int val) { _poolPort = val; }
	int ThreadNum() const { return _threadNum; }
	void ThreadNum(int val) { _threadNum = val; }

	std::string PasswordSha1();

	void resetMinerStartTime();
	boost::posix_time::ptime minerStartTime();

	uint32 uniqueMerkleSeedGenerator;
	uint32 miningStartTime;

	CRITICAL_SECTION cs_xptClient;
	xptClient_t* xptClient;
private:
	std::string _user;
	std::string _password;
	std::string _poolIp;
	int _poolPort;
	int _threadNum;
	boost::posix_time::ptime _minerStartTime;
};

